<script>
	 $(function(){
  $('.confirm').click(function(){
    var r=confirm("Apakah Anda yakin akan menghapus data? ")
  if (r==false)
    {
    return false;
    }
  });
});  
</script>
<?php if(!defined('BASEPATH')) exit ('No direct script access allowed');?>
<div id="main-content">
	<div class='title'>Daftar User</div>
	
	<?php echo anchor('con_user/tambah','Tambah User Baru');?>
	<table class='data' width='100%'>
		<tr>
			<th width='30%' align='left'>Nama</th>
			<th width='20%' align='left'>NIP</th>
			<th width='24%' align='left'>User Name</th>
			<th width='20%' align='center'>Aksi</th>
		</tr>
		<?php
		foreach($all_user->result() as $row)
		{
		?>
		<tr>
			<td><?php echo $row->NAMA;?></td>
			<td><?php echo $row->NIP;?></td>
			<td><?php echo $row->USERNAME;?></td>
			<td align='center'>
			<?php
			echo anchor('con_user/edit/'.$row->ID_USER,'<img src="'.base_url().'asset/icon/edit.png" alt="Hapus" width="20" height="20" />');
			echo '-';
			echo anchor('con_user/hapus/'.$row->ID_USER,'<img src="'.base_url().'asset/icon/hapus.png" alt="Hapus" width="20" height="20" />',array('class'=>'confirm'));
			?>
			</td>
		</tr>
		<?php
		}
		?>
		</table>
</div>